build: Conditionally build GPGME-related sources
authorDenis Pynkin <denis.pynkin@collabora.com>
Sun, 19 May 2019 13:47:45 +0000 (16:47 +0300)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 1 Aug 2019 02:06:47 +0000 (02:06 +0000)
Do not build GPGME-related sources if flag USE_GPGME is not defined.

Signed-off-by: Denis Pynkin <denis.pynkin@collabora.com>
Closes: #1889
Approved by: cgwalters

Makefile-libostree.am
Makefile-man.am
Makefile-ostree.am
Makefile-otutil.am
Makefile.am

index 1f1e0bc7aff051b37bd5df01db84effae948a772..61763f950fa0c997e62d5927416971e550cd29a1 100644 (file)
@@ -126,10 +126,6 @@ libostree_1_la_SOURCES = \
        src/libostree/ostree-repo-static-delta-compilation.c \
        src/libostree/ostree-repo-static-delta-compilation-analysis.c \
        src/libostree/ostree-repo-static-delta-private.h \
-       src/libostree/ostree-gpg-verifier.c \
-       src/libostree/ostree-gpg-verifier.h \
-       src/libostree/ostree-gpg-verify-result.c \
-       src/libostree/ostree-gpg-verify-result-private.h \
        src/libostree/ostree-autocleanups.h \
        src/libostree/ostree-bloom.c \
        src/libostree/ostree-bloom-private.h \
@@ -169,6 +165,15 @@ libostree_1_la_SOURCES += \
        $(NULL)
 endif # USE_AVAHI
 
+if USE_GPGME
+libostree_1_la_SOURCES += \
+       src/libostree/ostree-gpg-verifier.c \
+       src/libostree/ostree-gpg-verifier.h \
+       src/libostree/ostree-gpg-verify-result.c \
+       src/libostree/ostree-gpg-verify-result-private.h \
+       $(NULL)
+endif # USE_GPGME
+
 symbol_files = $(top_srcdir)/src/libostree/libostree-released.sym
 if BUILDOPT_IS_DEVEL_BUILD
 symbol_files += $(top_srcdir)/src/libostree/libostree-devel.sym
index 8ccbba8c6ef0abe42ad1b9c0418777e5af6a3409..c27a9a5593112ef85828b680abba0b7657269657 100644 (file)
@@ -28,7 +28,7 @@ ostree-admin-status.1 ostree-admin-set-origin.1 ostree-admin-switch.1 \
 ostree-admin-undeploy.1 ostree-admin-upgrade.1 ostree-admin-unlock.1   \
 ostree-admin-pin.1 \
 ostree-admin.1 ostree-cat.1 ostree-checkout.1 ostree-checksum.1                \
-ostree-commit.1 ostree-create-usb.1 ostree-export.1 ostree-gpg-sign.1 \
+ostree-commit.1 ostree-create-usb.1 ostree-export.1 \
 ostree-config.1 ostree-diff.1 ostree-find-remotes.1 ostree-fsck.1 \
 ostree-init.1 ostree-log.1 ostree-ls.1 ostree-prune.1 ostree-pull-local.1 \
 ostree-pull.1 ostree-refs.1 ostree-remote.1 ostree-reset.1 \
@@ -45,6 +45,10 @@ if BUILDOPT_FUSE
 man1_files += rofiles-fuse.1
 endif
 
+if USE_GPGME
+man1_files += ostree-gpg-sign.1
+endif
+
 man5_files = ostree.repo.5 ostree.repo-config.5
 
 man1_MANS = $(addprefix man/,$(man1_files))
index 92881a3190689db4c6b525a520087434de060be4..76f39cad4b746b68376813c20858143d6989fc3d 100644 (file)
@@ -34,7 +34,6 @@ ostree_SOURCES = src/ostree/main.c \
        src/ostree/ot-builtin-export.c \
        src/ostree/ot-builtin-find-remotes.c \
        src/ostree/ot-builtin-fsck.c \
-       src/ostree/ot-builtin-gpg-sign.c \
        src/ostree/ot-builtin-init.c \
        src/ostree/ot-builtin-pull-local.c \
        src/ostree/ot-builtin-log.c \
@@ -65,6 +64,12 @@ ostree_SOURCES += \
        $(NULL)
 endif
 
+if USE_GPGME
+ostree_SOURCES += \
+       src/ostree/ot-builtin-gpg-sign.c \
+       $(NULL)
+endif
+
 # Admin subcommand
 ostree_SOURCES += \
        src/ostree/ot-admin-builtin-init-fs.c \
@@ -95,13 +100,18 @@ ostree_SOURCES += \
        src/ostree/ot-remote-builtins.h \
        src/ostree/ot-remote-builtin-add.c \
        src/ostree/ot-remote-builtin-delete.c \
-       src/ostree/ot-remote-builtin-gpg-import.c \
        src/ostree/ot-remote-builtin-list.c \
        src/ostree/ot-remote-builtin-show-url.c \
        src/ostree/ot-remote-builtin-refs.c \
        src/ostree/ot-remote-builtin-summary.c \
        $(NULL)
 
+if USE_GPGME
+ostree_SOURCES += \
+       src/ostree/ot-remote-builtin-gpg-import.c \
+       $(NULL)
+endif
+
 
 if USE_CURL_OR_SOUP
 ostree_SOURCES += src/ostree/ot-remote-builtin-add-cookie.c \
index 5bafb2d069c0f3b5a311be7fb1aabae43b2a03ca..e8901b57dad463409c8ab6fb3422d1d44c3cff64 100644 (file)
@@ -40,11 +40,17 @@ libotutil_la_SOURCES = \
        src/libotutil/ot-variant-builder.h \
        src/libotutil/ot-gio-utils.c \
        src/libotutil/ot-gio-utils.h \
-       src/libotutil/ot-gpg-utils.c \
-       src/libotutil/ot-gpg-utils.h \
        src/libotutil/otutil.h \
        src/libotutil/ot-tool-util.c \
        src/libotutil/ot-tool-util.h \
        $(NULL)
+
+if USE_GPGME
+libotutil_la_SOURCES += \
+       src/libotutil/ot-gpg-utils.c \
+       src/libotutil/ot-gpg-utils.h \
+       $(NULL)
+endif
+
 libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS) $(OT_INTERNAL_GPGME_CFLAGS) $(LIBSYSTEMD_CFLAGS)
 libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS) $(OT_INTERNAL_GPGME_LIBS) $(LIBSYSTEMD_LIBS)
index 4850cdddb3790f7c97ecdda7831d184edf144a60..cd04a055045adafdf4f7875ab91f35d1c5ab1f2e 100644 (file)
@@ -57,8 +57,10 @@ OT_INTERNAL_SOUP_CFLAGS = $(OT_DEP_SOUP_CFLAGS)
 OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
 
 # This canonicalizes the PKG_CHECK_MODULES or AM_PATH_GPGME results
+if USE_GPGME
 OT_INTERNAL_GPGME_CFLAGS = $(OT_DEP_GPGME_CFLAGS) $(GPGME_PTHREAD_CFLAGS)
 OT_INTERNAL_GPGME_LIBS = $(OT_DEP_GPGME_LIBS) $(GPGME_PTHREAD_LIBS)
+endif
 
 if BUILDOPT_INTROSPECTION
 include $(INTROSPECTION_MAKEFILE)